﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="playerpicker.ascx.cs"
    Inherits="ffl_user_webusercontrols_playerpicker" %>
<asp:Panel runat="server" ID="PlayerPickerPanel">
    <table width="100%">
        <tr>
            <td colspan="2" class"tableheader" align="center">
                Player picker
            </td>
        </tr>
        <tr>
            <td>
                Select club:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="ClubDropDown" OnSelectedIndexChanged="ClubDropDown_SelectedIndexChanged" 
                    AutoPostBack="true" DataTextField="ClubName" DataValueField="Id">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Select position:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="PositionDropDown" DataTextField="PositionName" DataValueField="Id" 
                    OnSelectedIndexChanged="PositionDropDown_SelectedIndexChanged" AutoPostBack="true">
                </asp:DropDownList>
            </td>
        </tr>
    </table>
    <asp:Repeater runat="server" ID="PlayerPickerRepeater" OnItemDataBound="PlayerPickerRepeater_ItemDataBound" 
        OnItemCommand="PlayerPickerRepeater_ItemCommand">
        <HeaderTemplate>
        </HeaderTemplate>
        <ItemTemplate>
            <div style="height: 55px;">
                <asp:HiddenField runat="server" ID="PlayerIdHidden" Value='<%# DataBinder.Eval(Container.DataItem, "PlayerId") %>' />
                <asp:HiddenField runat="server" ID="EspnRefHidden" Value='<%# DataBinder.Eval(Container.DataItem, "EspnPlayerId") %>' />
                <asp:Panel ID="PlayerPanel" runat="server" Width="250px" BorderStyle="Solid" BorderColor="#aaaaaa"
                    BorderWidth="1" Height="50px" BackColor="#f2f9ff">
                    <table style="width: 100%; height: 100%;">
                        <tr>
                            <td style="width: 36px;" valign="middle" align="left">
                                <asp:Image ID="PlayerImage" runat="server" Width="36px" Height="50px" AlternateText='<%# DataBinder.Eval(Container.DataItem, "Forename") + " " + DataBinder.Eval(Container.DataItem, "Surname") %>' />
                            </td>
                            <td valign="middle" align="left" style="text-indent: 5px">
                                <%# DataBinder.Eval(Container.DataItem, "Forename") + " " + DataBinder.Eval(Container.DataItem, "Surname") %>
                            </td>
                            <td style="width: 14px;" valign="middle" align="right">
                                <asp:Button ID="AddPlayerButton" runat="server" Text=" + " BackColor="#c6c6ff" ForeColor="#ffffff"
                                    BorderColor="#cccccc" UseSubmitBehavior="true" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
        </ItemTemplate>
        <FooterTemplate>
        </FooterTemplate>
    </asp:Repeater>
</asp:Panel>
